package com.zyfu.mybatis.demo.controller;

import com.zyfu.mybatis.demo.entity.User;
import com.zyfu.mybatis.demo.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <b>请输入名称</b>
 * <pre>
 * 描述<br/>
 * 作用：；<br/>
 * 限制：；<br/>
 * </pre>
 *
 * @author 张永福
 * @since 2024/2/6 11:15
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;


    @RequestMapping("add")
    public int add(@RequestBody User user) {
        return userService.add(user);
    }

    @RequestMapping("batch-add")
    public void batchAdd(@RequestBody List<User> userlist) {
        userService.batchAdd(userlist);
        System.out.println(11);
    }
}
